<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>店铺进货列表</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        function page(n,s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").attr("action","${ctx}/sys/CheckAllController/orderList");
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sys/CheckAllController/orderList">所有订单列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="tbOrder" action="${ctx}/sys/CheckAllController/orderList"
           method="post" class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <li><label>订单状态：</label>
        <select id="box" name="orderStateStr" class="input-medium">
            <option value="">全部</option>
            <option  value="0" <c:if test="${tbOrder.orderStateStr=='7'}"> selected</c:if> > 未确认（未支付）</option>
            <option  value="1" <c:if test="${tbOrder.orderStateStr=='1'}"> selected</c:if> > 已确认(已支付)</option>
            <option  value="2" <c:if test="${tbOrder.orderStateStr=='2'}"> selected</c:if> > 待发货</option>
            <option  value="3" <c:if test="${tbOrder.orderStateStr=='3'}"> selected</c:if> > 已发货</option>
            <option  value="4" <c:if test="${tbOrder.orderStateStr=='4'}"> selected</c:if> > 已完成</option>
            <option  value="5" <c:if test="${tbOrder.orderStateStr=='5'}"> selected</c:if> > 已取消</option>
            <option  value="6" <c:if test="${tbOrder.orderStateStr=='6'}"> selected</c:if> > 已关闭</option>
        </select>
    </li>
    <li><label>联系人：</label><form:input path="contactName" htmlEscape="false" maxlength="50" class="input-medium"/> </li>
    &nbsp;
    <li><label>日期范围：&nbsp;</label>
        <input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
               value="<fmt:formatDate value="${tbOrder.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
        --&nbsp;<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
                       value="<fmt:formatDate value="${tbOrder.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;&nbsp;
    </li>
    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
</form:form>
<sys:message content="${message}"/>
<span><font style="color: #00A6C7">${message1}</font></span>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>订单号</th>
        <th>订单状态</th>
        <th>订单时间</th>
    <%--    <th>订单总额</th>--%>
        <th>联系人</th>
        <th>联系电话</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="tbOrder">
        <tr>
            <td>${tbOrder.orderNo}</td>
            <td>
                <c:if test="${tbOrder.orderState eq '0'}">
                    未确认（未支付）
                </c:if>
                <c:if test="${tbOrder.orderState eq '1'}">
                    已确认(已支付)
                </c:if>
                <c:if test="${tbOrder.orderState eq '2'}">
                    待发货
                </c:if>
                <c:if test="${tbOrder.orderState eq '3'}">
                    已发货
                </c:if>
                <c:if test="${tbOrder.orderState eq '4'}">
                    已完成
                </c:if>
                <c:if test="${tbOrder.orderState eq '5'}">
                    已取消
                </c:if>
                <c:if test="${tbOrder.orderState eq '6'}">
                    已关闭
                </c:if>
            </td>
            <td><fmt:formatDate value="${tbOrder.orderTime}" type="both"/></td>
           <%-- <td>${tbOrder.orderAmount}</td>--%>
            <td>${tbOrder.contactName}</td>
            <td>${tbOrder.contactMobile}</td>
                <%--  <shiro:hasPermission name="sys:advertise:edit">--%>
            <td>
                <a href="${ctx}/sys/CheckAllController/queryOrder/${tbOrder.id}">查看明细</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>